/*
 * service_queue.h
 *
 *  Created on: 06/04/2010
 *      Author: bruno.silva
 */

#ifndef SERVICE_QUEUE_H_
#define SERVICE_QUEUE_H_

#include "target.h"
#include "kernel_FreeRTOS.h"

typedef xQueueHandle service_queue_Queue;

#define service_queue_INVALID_QUEUE ( ( service_queue_Queue ) 0 )

#define service_queue_CreateQueue(queueLength, itemSize) \
		xQueueCreate(queueLength, itemSize)

#define service_queue_QueueSend( Queue, ItemToQueue, TicksToWait ) \
		xQueueSend( Queue, ItemToQueue, TicksToWait )

#define service_queue_QueueReceive( Queue, Buffer, TicksToWait )\
	xQueueReceive( Queue, Buffer, TicksToWait )

#define service_queue_QueueReceiveFromISR( queueHandle, buffer, taskWoken)\
	xQueueReceiveFromISR( queueHandle, buffer,(portBASE_TYPE *) taskWoken)

#define service_queue_QueueSendFromISR( pxQueue, pvItemToQueue, pxHigherPriorityTaskWoken)\
	xQueueSendFromISR( pxQueue, pvItemToQueue,(portBASE_TYPE *) pxHigherPriorityTaskWoken)

#define service_queue_Delete(queue)\
	vQueueDelete( queue )

#define service_queue_MessagesInQueue(queue)\
	uxQueueMessagesWaitingFromISR( queue )

#endif /* SERVICE_QUEUE_H_ */
